import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue'; // 示例页面组件

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  // 其他路由配置
];

const router = createRouter({
  history: createWebHistory(),
  routes
});

// 添加全局前置守卫
router.beforeEach((to, from, next) => {
  // 在这里可以添加认证逻辑、权限检查等
  console.log('路由即将跳转，从', from.path, '到', to.path);
  
  // 继续路由跳转
  next();
});

export default router;